package com.fuxi.cloud.desreport.service.a;

import com.fuxi.cloud.desreport.dao.JimuReportMapDao;
import com.fuxi.cloud.desreport.entity.JmReportMap;
import com.fuxi.cloud.desreport.model.JmPage;
import com.fuxi.cloud.desreport.service.IJmReportMapService;
import org.apache.commons.lang3.StringUtils;
import org.jeecgframework.minidao.pojo.MiniDaoPage;
import org.jeecgframework.minidao.util.SnowflakeIdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * a
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */
@Service("jmReportMapServiceImpl")
public class k implements IJmReportMapService {
    @Autowired
    private JimuReportMapDao jimuReportMapDao;

    public k() {
    }

    @Override
    public void saveMapSource(JmReportMap jmReportMap) {
        if (StringUtils.isNotEmpty(jmReportMap.getId())) {
            this.jimuReportMapDao.update(jmReportMap);
        } else {
            jmReportMap.setId(String.valueOf(SnowflakeIdWorker.generateId()));
            this.jimuReportMapDao.insert(jmReportMap);
        }

    }

    @Override
    public JmPage<JmReportMap> queryPageList(JmReportMap map, Integer pageNo, Integer pageSize) {
        MiniDaoPage var4 = this.jimuReportMapDao.getAll(map, pageNo, pageSize);
        JmPage var5 = com.fuxi.cloud.desreport.b.b.a(var4);
        return var5;
    }

    @Override
    public void removeById(String id) {
        this.jimuReportMapDao.deleteById(id);
    }

    @Override
    public JmReportMap queryMapByCode(JmReportMap mapSource) {
        return this.jimuReportMapDao.queryMapByCode(mapSource);
    }
}

